home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2000 September / maximum-cd-2000-09.iso / Vampire the Masquerade / vampire_demo.exe / Codex.nob / RegionTriggerRotate.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-22  |  1.4 KB  |  35 lines

  1. public class RegionTriggerRotate extends Codex {
  2.    private CodexThing _rotateObject;
  3.    private int _frameNum = 1;
  4.    private float _duration = 3.0F;
  5.    private boolean bRotated;
  6.    public static String[] _params = new String[]{"Rotate object", "Rotate around frame;1", "Duration;3.0"};
  7.  
  8.    public RegionTriggerRotate(CodexThing rotateObject, int frameNum, float duration) {
  9.       this._rotateObject = new CodexThing(((Codex)rotateObject).GetGUID());
  10.       this._frameNum = frameNum;
  11.       this._duration = duration;
  12.    }
  13.  
  14.    public void restore(int flags) {
  15.       this.bRotated = CodexSequence.RestoreBoolean();
  16.    }
  17.  
  18.    public void entered(int guid, int causeGUID, int captureID) {
  19.       if (Codex.IsPlayerGuid(causeGUID)) {
  20.          if (!this.bRotated) {
  21.             CodexThing enterThing = new CodexThing(causeGUID);
  22.             if (enterThing.IsPlayer()) {
  23.                this._rotateObject.RotatePivot(this._frameNum, this._duration);
  24.                this.bRotated = true;
  25.             }
  26.          }
  27.  
  28.       }
  29.    }
  30.  
  31.    public void save(int flags) {
  32.       CodexSequence.SaveBoolean(this.bRotated);
  33.    }
  34. }
  35.